package com.example.baserecyclerviewadapterdemo.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.baserecyclerviewadapterdemo.R;
import com.example.baserecyclerviewadapterdemo.entity.HomeEntity;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

public class HomeAdapter extends BaseQuickAdapter<HomeEntity, BaseViewHolder> {

    public HomeAdapter(int layoutResId, @Nullable List<HomeEntity> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, HomeEntity homeEntity) {
        holder.setText(R.id.text, homeEntity.getTitle());
        holder.setImageResource(R.id.icon, homeEntity.getImageResource());
    }
}
